﻿#include "TurnTableDecode_TurnTable_RunningMode.h"

#include "TurnTableCodec.h"
#include "RegisterCenter_Device.h"
#include "Device.h"

TurnTableDecode_TurnTable_RunningMode::TurnTableDecode_TurnTable_RunningMode(TurnTableCodec *turnTableCodec)
{
  setObjectName(getClassNameFirstLow<TurnTableDecode_TurnTable_RunningMode>());
  this->turnTableCodec=turnTableCodec;
}

TurnTableDecode_TurnTable_RunningMode::~TurnTableDecode_TurnTable_RunningMode()
{

}

void TurnTableDecode_TurnTable_RunningMode::decode(char* const data,uint deviceId)
{
  registerCenter_Device->getDeviceById(deviceId)->setTurnTable_runningMode(dataBodyToInt(data,1));
}

RegisterCenter_Device* TurnTableDecode_TurnTable_RunningMode::getRegisterCenter_Device()const
{
  return registerCenter_Device;
}

TurnTableDecode_TurnTable_RunningMode* TurnTableDecode_TurnTable_RunningMode::setRegisterCenter_Device(RegisterCenter_Device* const registerCenter_Device)
{
  this->registerCenter_Device=registerCenter_Device;
  printInjection(this,registerCenter_Device);
  return this;
}

void TurnTableDecode_TurnTable_RunningMode::objectAutoInjection(QHash<QString,QObject*>* objMap)
{
  setRegisterCenter_Device(getObjFromMap<RegisterCenter_Device>(objMap));
}
